package com.gjy.learning.scala.util

import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.types.DataType

trait GetDFScheamType{
  //获取某df的某列的数据类型
  def getDFScheamaType(df: DataFrame, columnName: String): DataType = {
    val columnNameUpper: String = columnName.toUpperCase()
    val dataType: DataType = df.schema(columnNameUpper).dataType
    dataType
  }
}
